!!! 5
%html
  %head
    %meta(charset="utf-8")
    %title= ((@title)?(@title + " - "):("#{controller.controller_name}: #{controller.action_name}")) + "Lab Specimen Transport"
    = javascript_include_tag :defaults
    %script{:type => "text/javascript", :src  => "http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"}
    %script{:type => "text/javascript", :src  => "http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"}
    %script{:type => "text/javascript"} $(function() {$( ".sortable" ).sortable({connectWith: ".sortable"}).disableSelection();});
    = javascript_include_tag :defaults
    = stylesheet_link_tag 'global'
    = stylesheet_link_tag 'main'
    = stylesheet_link_tag 'stops'
    = stylesheet_link_tag 'view'
    = stylesheet_link_tag 'edit'
    = stylesheet_link_tag 'new'
    = stylesheet_link_tag 'routes' if controller.class == RoutesController
    = stylesheet_link_tag 'checklists' if controller.class == ChecklistsController
    = stylesheet_link_tag 'print', :media => :print
  %body
    %div{:id => "container"}
      %div{:id => "header"}
        %h1= link_to 'UW SPS', root_path
        = render :partial => '/partials/header'
      - if flash[:notice]
        #flash= flash[:notice]
      %div{:id => "sidebar"}
        %ul
          - if (["client", "courier"].include? @current_user.permission_level)
            %li{:class => "items"}
              %a{:anchor => "items"}= "Items"
          - else
            %li{:class => "items#{controller.class == ItemsController && controller.action_name == 'index' ? ' current' : ''}"}= link_to "Items", :controller => :items, :action => :index
          %li  
            %ul
              %li{:class => "incoming#{controller.class == ItemsController && controller.action_name == 'incoming' ? ' current' : ''}"}= link_to "Incoming", :controller => :items, :action => :incoming if not ["client", "courier"].include? @current_user.permission_level
              %li{:class => "outgoing#{controller.class == ItemsController && controller.action_name == 'outgoing' ? ' current' : ''}"}= link_to "Outgoing", :controller => :items, :action => :outgoing if not ["courier"].include? @current_user.permission_level
              %li{:class => "lookup#{controller.class == ItemsController && controller.action_name == 'lookup' ? ' current' : ''}"}= link_to "Lookup", :controller => :items, :action => :lookup
              %li{:class => "add#{controller.class == ItemsController && controller.action_name == 'new' ? ' current' : ''}"}= link_to "Add New", new_item_path if not ["courier"].include? @current_user.permission_level
              %li{:class => "checkin#{controller.class == CheckInsController ? ' current' : ''}"}= link_to "Checkin", check_ins_path if not ["courier"].include? @current_user.permission_level
              %li{:class => "lost#{controller.class == LostItemsController ? ' current' : ''}"}= link_to "Lost", lost_items_path if not ["courier"].include? @current_user.permission_level
          %li{:class => "couriers#{controller.class == CouriersController ? ' current' : ''}"}= link_to "Couriers", couriers_path if ["admin"].include? @current_user.permission_level
          %li{:class => "users#{controller.class == UsersController && controller.action_name != 'edit' ? ' current' : ''}"}= link_to "Users", users_path if ["admin", "supervisor"].include? @current_user.permission_level
          %li{:class => "locations#{controller.class == LocationsController ? ' current' : ''}"}= link_to "Locations", locations_path if ["admin"].include? @current_user.permission_level
          %li{:class => "routes#{controller.class == RoutesController && controller.action_name == 'index' ? ' current' : ''}"}= link_to "Routes", routes_path if ["admin"].include? @current_user.permission_level
          %li{:class => "checklists#{controller.class == ChecklistsController && controller.action_name == 'index' ? ' current' : ''}"}= link_to "Checklists", checklists_path if ["admin"].include? @current_user.permission_level
          %li{:class => "editaccount#{controller.class == UsersController && controller.action_name == 'edit' ? ' current' : ''}"}= link_to "Edit Account", edit_user_path(@current_user)
      = yield
      = render :partial => "layouts/footer"
